<?
$tip=array ('0'=>'Orice imobil','1'=>'Garsoniera','2'=>'Apartament 2 camere','3'=>'Apartament 3 camere','4'=>'Apartament 4 camere','5'=>'Teren','6'=>'Spatiu Comercial','7'=>'Casa/Vila');
$oferta=array ('0'=>'Orice cerere','1'=>'Vanzare','2'=>'Inchiriere');


$locatii[0]='Oricare zona';
$query_locatii=mysql_query("SELECT id,name FROM locatii where id_parent=0 order by name");
while ($locatii_array=mysql_fetch_array($query_locatii))
	$locatii[$locatii_array['id']]=$locatii_array['name'];

$query_parteneri=mysql_query("SELECT * FROM parteneri ");
while ($parteneri_array=mysql_fetch_array($query_parteneri))
	$parteneri[]=$parteneri_array;


#$file = fopen("http://www.bnro.ro/Ro/Info/curs_ext.asp", "r"); 
#
#$today = date("d-m-Y");
#
#$numeValuta = array("Dolar SUA","Euro","Gram Au","Dobinda luna curenta"); 
#while (!feof($file)) 
#    { 
#    $line = fgets($file, 1024); 
#
#    if (eregi('<TD class="bold">(.*)</TD>', $line, $out))     
#        { 
#        $cursvalutar = each ($out); 
#
#        while (list($key,$val)=each($numeValuta)) 
#            {            
#            if ($val == "Euro") 
#                {               
#                $euroi=str_replace('</TD>','',str_replace(",",".",str_replace('<TD class="bold">','',$cursvalutar[1]))); 
#                } 
#            if ($val == "Dolar SUA") 
#                {               
#            
#                $dolarel=str_replace('</TD>','',str_replace(",",".",str_replace('<TD class="bold">','',$cursvalutar[1]))); 
#            
#            
#                } 
#            break;
#            }
#        }
#    }
#fclose($file);

$dosar=$_SESSION['dosar'];
if ($dosar!='')
	$dosar=array_unique($dosar);

$numar_oferte=count ($dosar);
$smarty->assign('numar_oferte',$numar_oferte);
$smarty->assign('euro',$dolarel);  
$smarty->assign('dolar',$euroi);


$smarty->assign('locatii',$locatii);
$smarty->assign('tip',$tip);
$smarty->assign('oferta',$oferta);
$smarty->assign('parteneri',$parteneri);
$smarty->assign('head', $smarty->fetch(tmpd.'head'.tmpl_ext));
?>
